import { SelectControlSchema } from 'amis/lib/renderers/Form/Select'
import amisUtils from '@/components/amis/amisUtils'
import IamApplicationStatusEnum from '@/core/account/generated/enums/IamApplicationStatusEnum'

class IamApplicationStatusSelectUtils {
	getSchema = (parmas?: SelectControlSchema): SelectControlSchema => {
		const name = parmas?.name ? parmas.name : 'status'
		const mergeSchema = Object.assign(
			{
				name: name,
				type: 'select',
				label: '状态',
				clearable: true,
				options: amisUtils.getSelectOptionsFromBaseEnum(IamApplicationStatusEnum),
			},
			parmas,
		)

		const schema = mergeSchema
		return schema
	}
}

export default new IamApplicationStatusSelectUtils()
